<?php
/*  AjaxWhois Pro 1.0 for Joomla 1.5
*   by Uma Sharma bizguruji@softuff.org
*   Powered by Softuff eDevelopment - www.softuff.org
*
* @ Released under GNU/LGPL License : http://www.fsf.org/
**/

// ensure this file is being included by a parent file
if ( ! ( defined( '_VALID_AW' ) || defined( '_JEXEC' ) || defined( '_VALID_MOS' ) ) ) { die( 'Direct Access to this location is not allowed.' ); }

	if (substr($awParams->version,0,3) != "Pro") {
		echo "Compatibility Issue - Please Install the compatible Module Version";
		exit;
	}

	if ($_REQUEST['option'] == "com_ajaxwhois") { 
		$awComp = 1;
		$awHeight = "128px";
		$awDef = "/comp";
	} else {
		$awComp = 0;
		$awHeight = "80px";
		$awDef = "/module";
	}
	include(_AW_COMP_INCPATH."templates".DS.$awParams->awTemplate.$awDef."_def.php");

	JApplication::addCustomHeadTag( '<script type="text/javascript" src="'._AW_COMP_PATH.'templates/'.$awParams->awTemplate.'/js/divs.js"></script>' );
?>
	
    <?php include(_AW_COMP_INCPATH."templates".DS."default".DS."form.php"); ?>

<style type="text/css">
.divs { 
	display: block; 
	position: relative; 
	background: #aaa; 
	padding: 5px; 
	float: left; 
	color: #fff; 
	text-decoration: none;
	<?php if ($awParams->useImages == "on") { ?>
	height:<?php echo (($awParams->imageSize+3)*4)."px"; ?>;
	<?php } else { ?>
	height:<?php echo $awHeight; ?>;
	<?php } ?>
	margin:0 5px 5px 0;
}

.divs i, .divs span { 
	font-style: normal; 
	background-image:url(<?php echo _AW_COMP_PATH."templates/".$awParams->awTemplate."/images/divs.png"; ?>); 
	background-repeat: no-repeat; 
	display: block; 
	position: relative; 
	<?php if ($awParams->useImages == "on") { ?>
	height:<?php echo (($awParams->imageSize+3)*4)."px"; ?>;
	<?php } else { ?>
	height:<?php echo $awHeight; ?>;
	<?php } ?>
}

.divs i { 
	background-position: top left; 
	position: absolute; 
	margin-bottom: -5px;  
	top: 0; 
	left: 0; 
	width: 5px; 
	height: 5px; 
}

.divs span { 
	background-position: bottom left; 
	left: -5px; 
	padding: 0 0 5px 10px; 
	margin-bottom: -5px; 
}

.divs span i { 
	background-position: bottom right; 
	margin-bottom: 0; 
	position: absolute; 
	left: 100%; 
	width: 10px; 
	height: 100%; 
	top: 0; 
}

.divs span span { 
	background-position: top right; 
	position: absolute; 
	right: -10px; 
	margin-left: 10px; 
	top: -5px; 
	height: 0; 
}

* html .divs span,
	* html .divs i { 
	float: left; 
	width: auto; 
	background-image: none; 
	cursor: pointer; 
}
<?php 
	echo ".divs.ajaxlog { \n"
	."background:$divsBG; \n"
	."color:$divsColor; \n"
	."}\n"; ?>

.divs[class] {  
	background-image: url(<?php echo _AW_COMP_PATH."templates/".$awParams->awTemplate."/images/shade.png"; ?>); 
	background-position: bottom; 
}

* html .divs { 
	border: 3px double #aaa; 
}

<?php
	echo "* html .divs.ajaxlog { \n"
	."border: $divsBG; \n"
	."}\n"; ?>

<?php for ($i=0;$i<51;$i++) {
	echo "div#ajaxlog".$i.", \n";
} ?>

div#ajaxlog51 {
	<?php if ($awParams->useImages == "on") { ?>
	height:<?php echo (($awParams->imageSize+3)*4)."px"; ?>;
	<?php } else { ?>
	height:<?php echo $awHeight; ?>;
	<?php } ?>
}

<?php if ($awComp == 0) { ?>
.ajax-loading {
	background:url(<?php echo "images/spinner.gif"; ?>) no-repeat 0 0;
	padding-left: 20px;
}

span.ajax-loading, 
div#ajaxlogC div.domainext, 
div#ajaxlogC div.result, 
div#ajaxlogC div.result0, 
div#ajaxlogC div.result1, 
div#ajaxlogC div.whois, 
div#ajaxlogC div.register {
<?php if ($awParams->useImages == "on") { ?>
	height:<?php echo ($awParams->imageSize+3)."px"; ?>;
	line-height:<?php echo ($awParams->imageSize+3)."px"; ?>;
<?php } else { ?>
	height:19px;
	line-height:19px;
<?php } ?>
	font-size:13px;
	width:100px;
}
<?php } ?>
</style>

	<div id="ajaxlogs">
	</div>
    <div id="ajaxlogC">
		<div id="whoisBoxHead">
    		<span id="domain"></span>
		</div>
		<?php for ($i=0; $i<$extsCount; $i++) { ?>
          <div id="ext-<?php echo $i; ?>" class="divs ajaxlog">
			  <div id="ajaxlog<?php echo $i; ?>">
			  </div>
          </div>
		<?php } ?>
    </div>
    <div style="clear:both;"></div>
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
      <tr>
        <td id="whois-b" width="100%">
        </td>
      </tr>
    </table>
    
	<script type="text/javascript">
	  var checkingDiv = '<?php echo $checkingDiv; ?>';
	  function showDivs() {
	    me = document.domainForm;
	    for (var i=1; i < me.length; i++) {
		  var k = 0;
		  for (j=1; j < me.length; j++) {
		    var x = 'ext-'+(j-1);
			$(x).style.visibility = 'hidden';
			if (me[j].checked) {
			  $('ext-'+k).style.visibility = 'visible';
			  k++;
			}
		  }
	    }
	  }
	  showDivs();
	  document.domainForm.domainname.autocomplete = 'off';
	</script>
